﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DispatchAssist.BusinessLogical.Model
{
    /// <summary>
    /// AlertRule
    /// </summary>
    public class AlertRule
    {

        /// <summary>
        /// AlertRule 构造函数
        /// </summary>
        public AlertRule()
        { }


        /// <summary>
        /// AlertRule OR映射构造函数
        /// </summary>
        public AlertRule(System.Data.IDataReader dr)
        {
            this.AlertRuleID = (Guid)dr["AlertRuleID"];
            this.Airport = Convert.ToString(dr["Airport"]);
            this.WarnLevel = Convert.ToInt32(dr["WarnLevel"]);
            this.AlertActionFlag = Convert.ToInt32(dr["AlertActionFlag"]);
            this.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            this.DeleteFlag = Convert.ToBoolean(dr["DeleteFlag"]);
        }


        /// <summary>
        /// 唯一标识
        /// </summary>
        public Guid AlertRuleID { get; set; }

        /// <summary>
        /// 机场
        /// </summary>
        public string Airport { get; set; }

        /// <summary>
        /// 预警级别
        /// </summary>
        public int WarnLevel { get; set; }

        /// <summary>
        /// 告警行为位叠加
        /// </summary>
        public int AlertActionFlag { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime LastModifyTime { get; set; }

        /// <summary>
        /// 逻辑删除标记
        /// </summary>
        public bool DeleteFlag { get; set; }

        public override string ToString()
        {
            return string.Format("[机场：{0}，预警等级：{1}]", this.Airport, this.WarnLevel);
        }
    }
}
